efform_onload = function ()
{  
 	efgrid.submitInqu( "ef_grid_r", "ZM","ZMCC12","query"); 
	var _info = new EiInfo();
	EiCommunicator.send("ZMCC13", "query", _info, ajax_select_callback);  
	EiCommunicator.send("ZMCC14", "query", _info, ajax_select_callback1); 
};   
button_query_onclick = function ()
{
	efgrid.submitInqu( "ef_grid_r", "ZM","ZMCC12","query");
} 
efgrid_onRowClicked = function( grid_id, row_index ){//点击主表行查询从表数据
	if(grid_id == "ef_grid_r"){ 
		var grid = efgrid.getGridObject(grid_id);
		var fdKeyId=grid.getCellValueByColumnName(row_index,"fdKeyId"); 
		var fdPenaltyIds=grid.getCellValueByColumnName(row_index,"fdPenaltyIds"); 
		var info = new EiInfo();
		info.set("fdKeyId",fdKeyId);    
		EiCommunicator.send("ZMCC13", "query", info, ajax_select_callback);  
		var info1 = new EiInfo();
		info1.set("fdPenaltyIds",fdPenaltyIds); 
		EiCommunicator.send("ZMCC14", "query", info1, ajax_select_callback1); 
	}
}
var ajax_select_callback= {
	onSuccess: function(eiInfo) { 
		 efwindow.hide();
		 var grid = efgrid.getGridObject("ef_grid_s");
		 grid.refresh(eiInfo);
	},
	onFail:function(eMsg)
	{
		EFAlert("新增失败，原因："+eMsg); 
	}
}
var ajax_select_callback1= {
	onSuccess: function(eiInfo) { 
		 efwindow.hide();
		 var grid = efgrid.getGridObject("ef_grid_p");
		 grid.refresh(eiInfo);
	},
	onFail:function(eMsg)
	{
		EFAlert("新增失败，原因："+eMsg); 
	}
}
efgrid_onCellDisplayReady = function( div_node_html, row_index, col_index, col_value_c, display_value ,grid_id)
{	
   var grid_obj = efgrid.getGridObject(grid_id);
   var columnEname = grid_obj.getColumn(col_index, TYPE_DATA).getEname();
   if( columnEname == "fdProblemStatus"  &&  grid_id=="ef_grid_r")
	{  
	 	var isNewLine = grid_obj.isNewLine(row_index);
        if(!isNewLine)
        {
            var html = "";
            if (col_value_c == "1") html = "<div align=center><font color='blue'>"+display_value+"</font></div>";   
            else if (col_value_c == "2") html = "<div align=center><font color='green'>"+display_value+"</font></div>";   
            else if (col_value_c == "3") html = "<div align=center><font color='red'>"+display_value+"</font></div>";   
            else if (col_value_c == "4") html = "<div align=center><font color='grey'>"+display_value+"</font></div>";   
            else if (col_value_c == "5") html = "<div align=center><font color='orange'>"+display_value+"</font></div>";   
            else html = "<div align=center>"+display_value+"</div>";   
            return html; 
        }else
        {	
            return;
        }
	}	
}